<?php
 Session_Start () ;
 Include ($_SESSION ["repertoire_config"]."/garennes.cfg") ;
 Include ($_SESSION ["repertoire_config"]."/init.php") ;
 Include ($_SESSION ["repertoire_config"]."/module_vie_scolaire.php") ;
 Include ("../include/config.inc") ;
 verif_droits ($droit_courant, $_SESSION ["code"]) ;
 $id_utilisateur = utilparcode ($_SESSION ["code"]) ;
 
 Include ("../../include/var_temp.inc") ;

 $titre = "Self du mercredi" ;
 $titre_affichage = "Self du <FONT COLOR='#0000FF'>Mercredi</FONT>" ;
 $choix = "self_mercredi_".$id_utilisateur ;
 $page = "./vs_affiche_self_mercredi.php" ;
 $type = 1 ;
 
 $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='".$droit_courant."' AND ordre='0'", $id_sql) ;
 $l = SQL_tableau_associatif ($resultats, "") ;
 Echo "<HTML><HEAD>" ;
 entete_html ("Garennes", "", 1) ;
 Echo styles ("none", "none", "none", $l ["nom"], "none") ;
 Echo "</HEAD>" ;
 Echo "<BODY BACKGROUND=\"../images/fond.png\" TEXT=\"".$theme [0][4]."\" onContextMenu=\"return false\">" ;
 Echo affiche_travail ("travail_menu", "<FONT SIZE='+1'><B>".$titre_affichage."</B></FONT>", $l ["couleur_fond"]) ;
 Echo "<BR>" ;

 Echo "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\">" ;
 Echo "<TR>" ;
 Echo "<TD>" ;

 $param = recup_parametrage ($choix) ;
 Echo "<FORM ACTION=\"".$page."\" METHOD=\"POST\">" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"type\" VALUE=\"".$type."\">" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"choix\" VALUE=\"".$choix."\">" ;
 Echo "<INPUT TYPE=\"HIDDEN\" NAME=\"titre\" VALUE=\"".$titre."\">" ;
 Echo "<TABLE BORDER=\"1\" BGCOLOR=\"".$l ["couleur_fond"]."\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\" STYLE=\"border:1px solid #000000;border-collapse:collapse\">" ;
 Echo "<TR>" ;
 Echo "<TD>" ;
 Echo "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\">" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Date&nbsp;de&nbsp;d&eacute;part</B>&nbsp;:&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\">" ;
 Echo "<SELECT NAME=\"jour\">" ;
 For ($i = 1 ; $i < 32 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["jour"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."</OPTION>" ;
  }
 Echo "</SELECT>" ;
 Echo "<SELECT NAME=\"mois\">" ;
 For ($i = 1 ; $i < 13 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["mois"][0]) { Echo " SELECTED" ; }
   Echo ">".$nom_mois [$i]."</OPTION>" ;
  }
 Echo "</SELECT>" ;
 Echo "<SELECT NAME=\"annee\">" ;
 For ($i = Date ("Y")-1 ; $i < Date("Y")+2 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($i == $param ["annee"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."</OPTION>" ;
  }
 Echo "</SELECT>&nbsp;" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Dur&eacute;e</B>&nbsp;:&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\">" ;
 Echo "<SELECT NAME=\"duree\">" ;
 For ($i = 1 ; $i < 13 ; $i++)
  {
   Echo "<OPTION VALUE=\"".($i*7)."\"" ;
   If ($i*7 == $param ["duree"][0]) { Echo " SELECTED" ; }
   Echo ">".$i."&nbsp;semaine" ; If ($i > 1) { Echo "s" ; }
   Echo "</OPTION>" ;
  }
 Echo "</SELECT>&nbsp;" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Premi&egrave;re&nbsp;partie&nbsp;:&nbsp;De&nbsp;A&nbsp;&agrave;</B>&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\">" ;
 Echo "<SELECT NAME=\"lettre\">" ;
 //Echo "             <OPTION VALUE=\"\">Aucune</OPTION>" ;
 For ($i = 2 ; $i <= 25 ; $i++)
  {
   Echo "<OPTION VALUE=\"".$i."\"" ;
   If ($param ["lettre"][0] == $i) { Echo " SELECTED" ; }
   Echo ">".Chr ($i+64)."</OPTION>" ;
  }
 Echo "</SELECT><B>.&nbsp;Deuxi&egrave;me&nbsp;partie&nbsp;:&nbsp;Tout&nbsp;le&nbsp;reste&nbsp;jusqu'&agrave;&nbsp;Z.</B>" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\">&nbsp;<B>Autorisation</B>&nbsp;:&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\">" ;
 Echo "<SELECT NAME=\"autorisation\">" ;
 $resultats = SQL_commande ("SELECT * FROM vs_types_autorisations ORDER BY nom", $id_sql) ;
 For ($i = 0 ; $i < SQL_nbr_lignes ($resultats) ; $i++)
  {
   $ligne = SQL_tableau_associatif ($resultats, "") ;
   Echo "<OPTION VALUE=\"".$ligne ["id_type_autorisation"]."\"" ;
   If ($param ["autorisation"][0] == $ligne ["id_type_autorisation"]) { Echo " SELECTED" ; }
   Echo ">".$ligne ["nom"]."</OPTION>" ;
  }
 Echo "</SELECT>" ;
 Echo "&nbsp;&nbsp;<INPUT TYPE=\"CHECKBOX\" NAME=\"inverse\" VALUE=\"1\"" ;
 If ($param ["inverse"][0] == 1) { Echo " CHECKED" ; }
 Echo ">&nbsp;Autorisation&nbsp;inverse&nbsp;" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\" vALIGN=\"TOP\">&nbsp;<B>R&eacute;gime</B>&nbsp;:&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\" vALIGN=\"MIDDLE\">" ;
 $resultats = SQL_commande ("SELECT * FROM types_regimes ORDER BY code", $id_sql) ;
 For ($i = 0 ; $i < SQL_nbr_lignes ($resultats) ; $i++)
  {
   $ligne = SQL_tableau_associatif ($resultats, "") ;
   Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"regime_".$ligne ["code"]."\"" ;
   If ($param ["regime"][$ligne ["code"]] == 1) { Echo " CHECKED" ; }
   Echo ">".$ligne ["nom_long"] ;
   If ($i < SQL_nbr_lignes ($resultats)-1) { Echo "<BR>" ; } Else { Echo "" ; }
  }
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"RIGHT\" vALIGN=\"TOP\">&nbsp;<B>Jours&nbsp;valides</B>&nbsp;:&nbsp;</TD>" ;
 Echo "<TD ALIGN=\"LEFT\" vALIGN=\"MIDDLE\">" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_1\"" ; If ($param ["jo"][1] == 1) { Echo " CHECKED" ; }
 Echo ">Lundi<BR>" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_2\"" ; If ($param ["jo"][2] == 1) { Echo " CHECKED" ; }
 Echo ">Mardi<BR>" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_3\"" ; If ($param ["jo"][3] == 1) { Echo " CHECKED" ; }
 Echo ">Mercredi<BR>" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_4\"" ; If ($param ["jo"][4] == 1) { Echo " CHECKED" ; }
 Echo ">Jeudi<BR>" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_5\"" ; If ($param ["jo"][5] == 1) { Echo " CHECKED" ; }
 Echo ">Vendredi<BR>" ;
 Echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"jo_6\"" ; If ($param ["jo"][6] == 1) { Echo " CHECKED" ; }
 Echo ">Samedi" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"2\">&nbsp;</TD></TR>" ;
 
 Echo "</TABLE>" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "</TABLE>" ;
 Echo "</TD>" ;
 
 Echo "<TD>&nbsp;&nbsp;</TD>" ;
 
 affiche_parametres_formatage () ;
 
 Echo "</TR>" ;
 Echo "</TABLE>" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "<TR><TD COLSPAN=\"3\">&nbsp;</TD></TR>" ;
 Echo "<TR>" ;
 Echo "<TD ALIGN=\"CENTER\" COLSPAN=\"3\">" ;
 Echo "<INPUT TYPE=\"SUBMIT\" NAME=\"partie_1\" VALUE=\" Premi&egrave;re partie \">&nbsp;&nbsp;" ;
 Echo "&nbsp;&nbsp;&nbsp;<INPUT TYPE=\"SUBMIT\" NAME=\"partie_2\" VALUE=\" Deuxi&egrave;me partie \">" ;
 Echo "</TD>" ;
 Echo "</TR>" ;
 Echo "</FORM>" ;

 Echo "</TABLE>" ;
 Echo "</BODY></HTML>" ;
?>